package cn.buk.tms.car.dao;


import cn.buk.tms.entity.misc.OperationLog;
import cn.buk.tms.entity.misc.RentalCarOrder;
import cn.buk.tms.car.sc.SearchCarOrderCriteria;

import java.util.List;

public interface CarOrderDao {

  /**
   * 新建组测订单
   *
   * @param orderInfo
   * @return
   */
  int createCarOrder(RentalCarOrder orderInfo);

  List<RentalCarOrder> searchOrders(int enterpriseId, SearchCarOrderCriteria sc);

  RentalCarOrder getOrderById(int orderId);

  int cancelRentalCarOrder(int enterpriseId, String username, int orderId);

  List<OperationLog> searchHistory(int enterpriseId, int orderId);

  int updateRentalCarOrderPrice(int enterpriseId, String username, int orderId, double price, double discount, double cost);

  int updateRentalCarOrderSupplier(int enterpriseId, String username, int orderId, int supplierId, int paymentMethodId);

  int updateRentalCarOrderPaymentMethod(int enterpriseId, String username, int orderId, int paymentMethodId);

  int processRentalCarOrder(int enterpriseId, String username, int orderId);

  int finishRentalCarOrder(int enterpriseId, String username, int orderId, String remark);

  /**
   * 查找需要校验差旅政策的订单
   * @param enterpriseId
   * @return
   */
  List<RentalCarOrder> searchMeetPolicyRentalCarOrders(int enterpriseId);

  int updateRentalCarOrderViolationStatus(int enterpriseId, String username, int orderId, int status, String remark);

  int updateRentalOrderApprover(int enterpriseId, String username, int orderId, String approver);

  List<RentalCarOrder> searchNeedAssignApproverRentalOrders(int enterpriseId);

  int rollbackOrder(int enterpriseId, String username, int orderId, String remark);

  int updateRentalCarOrder(int enterpriseId, String username, int orderId, int contentType, String content);
}
